// AskName.cpp : implementation of the CAskName class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"

#include "AskName.h"


LRESULT CAskName::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CenterWindow(GetParent());
	HWND edit = GetDlgItem(IDC_NAME);
	::SetFocus(edit);
	return TRUE;
}

LRESULT CAskName::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	GetDlgItemText(IDC_NAME, name);
	EndDialog(wID);
	return 0;
}

LRESULT CAskName::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	EndDialog(wID);
	return 0;
}
LRESULT CAskName::OnEnChangeName(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	CString tmp;
	GetDlgItemText(IDC_NAME,tmp);
	::EnableWindow(GetDlgItem(IDOK),!tmp.IsEmpty());
	return 0;
}
